#ifndef DTWENTYITEM_H
#define DTWENTYITEM_H


#include "dtwenty_global.h"


#include <modelitem.h>


class DTWENTYSHARED_EXPORT DTwentyItem : public ModelItem
{
    Q_OBJECT

public:
    Q_INVOKABLE DTwentyItem(QObject* parent = 0);
    DTwentyItem(const DTwentyItem& other);

    virtual int type() const;

};

Q_DECLARE_METATYPE(DTwentyItem)


template<typename CHILD_TYPE>
class DTwentyItemContainer : public DTwentyItem
{
    typedef DTwentyItemContainer<CHILD_TYPE> SelfType;

public:
    Q_INVOKABLE DTwentyItemContainer(QObject* parent = 0) :
        DTwentyItem(parent)
    {
        qRegisterMetaType<CHILD_TYPE*>();
    }

    DTwentyItemContainer(const DTwentyItemContainer& other) :
        DTwentyItem(other)
    {
    }

    virtual int type() const
    {
        return qMetaTypeId<SelfType*>();
    }

    virtual int childType() const
    {
        return qMetaTypeId<CHILD_TYPE*>();
    }
};



#endif // DTWENTYITEM_H
